<html>
<head><meta charset="utf-8"><title>Getting trailing comma · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Getting.20trailing.20comma.html">Getting trailing comma</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="166114040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Getting%20trailing%20comma/near/166114040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Getting.20trailing.20comma.html#166114040">(May 20 2019 at 19:46)</a>:</h4>
<p>Is their an easy way of getting the comma associated with a match arm. I'm working on merging match arms (<a href="https://github.com/rust-lang/rust/issues/1250" target="_blank" title="https://github.com/rust-lang/rust/issues/1250">#1250</a>) and need to know how to do this</p>



<a name="166114272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Getting%20trailing%20comma/near/166114272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Getting.20trailing.20comma.html#166114272">(May 20 2019 at 19:49)</a>:</h4>
<p>Not, comma is a sibling node of the match arm. <code>non_trivia_sibling(arm.syntax(), direction::Right)</code> should do the trick</p>



<a name="166115440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Getting%20trailing%20comma/near/166115440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Getting.20trailing.20comma.html#166115440">(May 20 2019 at 20:04)</a>:</h4>
<p>thanks</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>